<%-- 
    Document   : SubjectCodeTest
    Created on : 29/04/2008, 12:46:48
    Author     : DidierLeung
--%>

<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@ taglib uri="http://myfaces.apache.org/tomahawk" prefix="t"%>

<c:set var="pageTitle" value="Assignment Submission Form" scope="page"/>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${pageTitle}</title>
    </head>
    <body>
        <f:view>
            <!-- Show error messages -->
            <h:messages showSummary="true" showDetail="false"
                        style="color: red;
                        font-family: 'New Century Schoolbook', serif;
                        font-style: oblique"
                        id="errors"/>
        <h:form id="submitForm" enctype="multipart/form-data">
            <table>
                <tr>
                    <td colspan="3">
                        <h2>
                            <h:outputText value="Assignment Submission 2 for #{SubmissionManagedBean.subject} Form" />
                        </h2>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Select Assignment:</b>
                    </td>
                    <td colspan="2">
                        <h:selectOneMenu id="assignmentNo" value="#{SubmissionManagedBean.filterAssignmentNo}">
                            <f:selectItems value="#{SubmissionManagedBean.assignmentNoItems}"/>
                        </h:selectOneMenu>
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Upload Assignment</b>
                    </td>
                    <td colspan="2">
                        <t:inputFileUpload id="assignmentFile" value="#{SubmissionManagedBean.submissionFile}" 
                                           storage="file" required="true" size="50"/>
                        <!--h:inputText id="assignmentFile" value="{SubmissionManagedBean.assignmentFile}" 
                                    size="50" required="true" requiredMessage="Please insert an assignment file URL" /-->
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Student id:</b>
                    </td>
                    <td colspan="2">
                        <h:inputText id="studentId" value="#{SubmissionManagedBean.studentID}"
                                     required="true" requiredMessage="Please insert your student ID"/>
                                     
                    </td>
                </tr>
                <tr>
                    <td>
                        <b>Student Password:</b>
                    </td>
                    <td colspan="2">
                        <h:inputSecret id="studentPassword" value="#{SubmissionManagedBean.studentPassword}"
                                        required="true" requiredMessage="Please insert your password"/>
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <h:selectBooleanCheckbox title="acceptStatement"
                                                 value="#{SubmissionManagedBean.statementAgree}" 
                                             required="true" requiredMessage="Please select the agreement">
                        </h:selectBooleanCheckbox>
                        
                        <h:outputText value="I/We declare that this assignment is my/our own work.
                                         I/We have not worked collaboratively nor have I/We copied from any
                                                other student's work or from any other source" />
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        <hr />
                    </td>
                </tr>
                <tr>
                    <td>
                        <h:commandButton id="goBack" value="< Back" action="goBack" type="button" immediate="true"/>
                    </td>
                    <td>
                        <h:commandButton id="submit" value="Submit Assignment" action="#{SubmissionManagedBean.checkInput}" />
                    </td>
                    <td>
                        <h:commandButton id="cancel" value="Cancel" action="cancel" type="button" immediate="true"/>
                    </td>
                </tr>
            </table>
        </h:form>
        </f:view>
    </body>
</html>